#pragma once
#include <vector>
#include <string>
#include <map>
#include <iostream>

const int MAXSIZE = 50;

class grammatical
{
public:
	std::vector < std::pair < std::string, std::string> > words;
	std::vector < std::pair < std::string, std::string> > answer;
	std::map<std::string, int> dict;
	std::string str[37] = {" ", "main" ,"const","int" ,"break" ,"continue" ,"if" ,"else" ,"!" ,"&&" ,"||" ,"while" ,"getint" ,"printf" ,"return" ,
	"+", "-" , "void", "*", "/", "%", "<", "<=", ">", ">=", "==", "!=", "=", ";",",","(",")","[","]","{","}" };
	;
	void initGrammatical();
	std::pair<int,bool> match(int,int);
	std::vector < std::pair < std::string, std::string> > analysis(std::vector < std::pair < std::string, std::string> >);
};

